<?php
	$this->breadcrumbs=array(
		'Folders'=>array('admin'),
		$model->name=>array('view','id'=>$model->id),
		'SVN Update'
	);
	$this->renderPartial('_header',array('model'=>$model));
?>
<h1>SVN Update Folder "<?php echo $model->name; ?>"
</h1>
<?php if(!empty($error)) echo '<h1> Có lỗi trong quá trình Update</h1>'?>
<?php if(!isset($results)): ?>
	<?php $paths = explode("\n",$model->path); ?>
	<form action="" method="post">
		<table style="width:480px">


			<tr><td>Revision</td>
				<td><input type="text" name="revision_number" onkeypress="return numbersonly(this, event)">   </td>
			</tr>
			</table>
		<input type="submit" value="Update" name="submit">
	</form>
<?php else: ?>
<?php
foreach ($results as $result){
	echo '<div class="update_log">';
	foreach($result as $line){
		echo $line.'<br>';
	}
	echo '</div>';
}
	endif;
 ?>

<script language="JavaScript">
 	function numbersonly(myfield, e, dec)
	{
		var key;
		var keychar;

		if (window.event)
			key = window.event.keyCode;
		else if (e)
			key = e.which;
		else
			return true;
		keychar = String.fromCharCode(key);

		// control keys
		if ((key==null) || (key==0) || (key==8) ||
			(key==9) || (key==13) || (key==27) )
			return true;

		// numbers
		else if ((("0123456789").indexOf(keychar) > -1))
			return true;

		// decimal point jump
		else if (dec && (keychar == "."))
			{
			myfield.form.elements[dec].focus();
			return false;
			}
		else
			return false;
	}
 </script>
